/**
 * 
 */
package com.axxc.cloud.service.impl;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.axxc.cloud.mapper.IUserGeneralMapper;
import com.axxc.cloud.pojo.User;
import com.axxc.cloud.service.IUserGeneralService;
import com.github.pagehelper.Page;
import com.github.pagehelper.PageHelper;

/**
 * @ClassName: UserGeneral
 * @Description: TODO(通用mapper接口实现类)
 * @author 熊小川
 * @date 2018年5月6日 上午12:39:01
 */
@Service
@Transactional
public class UserGeneralServiceImpl implements IUserGeneralService {

	@Autowired
	private IUserGeneralMapper userGeneralMapper;

	public Page<User> listAllUser(Integer pageNum, Integer pageSize) {
		// 一句话搞定分页，其中1代表查询第一页，2代表每页显示2条 //从1开始
		PageHelper.startPage(pageNum, pageSize);
		PageHelper.orderBy("password desc");
		Page<User> page = (Page<User>) userGeneralMapper.selectAll();
		return page;
	}

}
